#ifndef ABB_H
#define ABB_H

#include "key.h"
#include "data.h"
#include "bool.h"
#include "tuple.h"
#include "pila.h"

typedef struct sAbb *Abb;

typedef struct Branch *Tree;

typedef struct node * stack2;

Abb abb_empty (void);

void abb_add (Abb h, key k, data d);

bool abb_exists (Abb h, key k);

data abb_search (Abb h, key k);

void abb_del (Abb h, key k);

int abb_length (Abb h);

Abb abb_fromFile(char *nomfile);

void abb_toFile(char *nomfile, Abb h);

void add_left_stack(Tree t,stack2 pila);

void abb_pprint (Abb l);

Abb abb_destroy(Abb h);

bool abb_is_empty(Abb h);

bool tree_is_empty(Tree h);

key root(Tree p);

Tree next(key k, Tree p);

key max_k(Tree p);

data max_d (Tree p);

void delete_max(Tree p);

Tree mk_leaf (key k, data d);

Tree tree_destroy (Tree t);

#endif
